﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Q.Spider.Core.Models
{
    public class CoreInfo
    {
        /// <summary>
        /// 开启时间
        /// </summary>
        public DateTime StatrTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 运行状态
        /// </summary>
        public CoreState State { get; set; } = CoreState.待运行;
        /// <summary>
        /// 描述信息
        /// </summary>
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// 成功请求数
        /// </summary>
        public long SuccessCount { get; set; }

        /// <summary>
        /// 抓取错误的数量
        /// </summary>
        public long ErrorCount { get; set; }

        /// <summary>
        /// 请求队列数量
        /// </summary>
        public long RequestQueueCount { get; set; }

        /// <summary>
        /// 运行时长，单位秒
        /// </summary>
        public double RunningTime => (DateTime.Now - StatrTime).TotalSeconds;

    }
}
